.class Lcom/estrongs/android/ui/dialog/m0$b;
.super Ljava/lang/Object;
.source "PermissionDialog.java"

# interfaces
.implements Les/nu$e;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/estrongs/android/ui/dialog/m0;->b()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Lcom/estrongs/android/ui/dialog/m0;


# direct methods
.method constructor <init>(Lcom/estrongs/android/ui/dialog/m0;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;)V
    .locals 12

    .line 1
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v0}, Lcom/estrongs/android/ui/dialog/m0;->d(Lcom/estrongs/android/ui/dialog/m0;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 3
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    const-string v1, "perms"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v0

    invoke-static {p1, v0}, Lcom/estrongs/android/ui/dialog/m0;->a(Lcom/estrongs/android/ui/dialog/m0;Lorg/json/JSONArray;)Lorg/json/JSONArray;

    goto :goto_0

    .line 4
    :cond_0
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    new-instance v0, Lorg/json/JSONArray;

    invoke-direct {v0}, Lorg/json/JSONArray;-><init>()V

    invoke-static {p1, v0}, Lcom/estrongs/android/ui/dialog/m0;->a(Lcom/estrongs/android/ui/dialog/m0;Lorg/json/JSONArray;)Lorg/json/JSONArray;

    .line 5
    :goto_0
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {p1}, Lcom/estrongs/android/ui/dialog/m0;->f(Lcom/estrongs/android/ui/dialog/m0;)Landroid/content/Context;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object p1

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v0}, Lcom/estrongs/android/ui/dialog/m0;->b(Lcom/estrongs/android/ui/dialog/m0;)Ljava/lang/String;

    move-result-object v0

    const/16 v1, 0x1000

    invoke-virtual {p1, v0, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v0

    .line 7
    new-instance v1, Lorg/json/JSONArray;

    invoke-direct {v1}, Lorg/json/JSONArray;-><init>()V

    .line 8
    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2}, Lorg/json/JSONArray;-><init>()V

    .line 9
    iget-object v3, v0, Landroid/content/pm/PackageInfo;->requestedPermissions:[Ljava/lang/String;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_3
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const-string v4, "permission"

    const/4 v5, 0x0

    if-eqz v3, :cond_4

    .line 10
    :try_start_1
    iget-object v0, v0, Landroid/content/pm/PackageInfo;->requestedPermissions:[Ljava/lang/String;

    array-length v3, v0

    const/4 v6, 0x0

    :goto_1
    if-ge v6, v3, :cond_4

    aget-object v7, v0, v6

    const/4 v8, 0x0

    const/4 v9, 0x0

    .line 11
    :goto_2
    iget-object v10, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v10}, Lcom/estrongs/android/ui/dialog/m0;->e(Lcom/estrongs/android/ui/dialog/m0;)Lorg/json/JSONArray;

    move-result-object v10

    invoke-virtual {v10}, Lorg/json/JSONArray;->length()I

    move-result v10

    if-ge v8, v10, :cond_2

    .line 12
    iget-object v10, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v10}, Lcom/estrongs/android/ui/dialog/m0;->e(Lcom/estrongs/android/ui/dialog/m0;)Lorg/json/JSONArray;

    move-result-object v10

    invoke-virtual {v10, v8}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v10

    .line 13
    invoke-virtual {v10, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v7, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 14
    invoke-virtual {v1, v10}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    const/4 v9, 0x1

    :cond_1
    add-int/lit8 v8, v8, 0x1

    goto :goto_2

    :cond_2
    if-nez v9, :cond_3

    .line 15
    new-instance v8, Lorg/json/JSONObject;

    invoke-direct {v8}, Lorg/json/JSONObject;-><init>()V
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_3
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 16
    :try_start_2
    invoke-virtual {p1, v7, v5}, Landroid/content/pm/PackageManager;->getPermissionInfo(Ljava/lang/String;I)Landroid/content/pm/PermissionInfo;

    move-result-object v7

    const-string v9, "name"

    .line 17
    invoke-virtual {v7, p1}, Landroid/content/pm/PermissionInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v7

    invoke-virtual {v8, v9, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "disable"

    .line 18
    invoke-virtual {v8, v7, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 19
    invoke-virtual {v2, v8}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
    :try_end_2
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_2 .. :try_end_2} :catch_0
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_3
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_3

    :catch_0
    move-exception v7

    .line 20
    :try_start_3
    invoke-virtual {v7}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    :cond_3
    :goto_3
    add-int/lit8 v6, v6, 0x1

    goto :goto_1

    :cond_4
    const/4 p1, 0x0

    .line 21
    :goto_4
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v0}, Lcom/estrongs/android/ui/dialog/m0;->e(Lcom/estrongs/android/ui/dialog/m0;)Lorg/json/JSONArray;

    move-result-object v0

    invoke-virtual {v0}, Lorg/json/JSONArray;->length()I

    move-result v0

    if-ge p1, v0, :cond_6

    .line 22
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {v0}, Lcom/estrongs/android/ui/dialog/m0;->e(Lcom/estrongs/android/ui/dialog/m0;)Lorg/json/JSONArray;

    move-result-object v0

    invoke-virtual {v0, p1}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v0

    .line 23
    invoke-virtual {v0, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v6, "-"

    invoke-virtual {v3, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 24
    invoke-virtual {v1, v0}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    :cond_5
    add-int/lit8 p1, p1, 0x1

    goto :goto_4

    .line 25
    :cond_6
    :goto_5
    invoke-virtual {v2}, Lorg/json/JSONArray;->length()I

    move-result p1

    if-ge v5, p1, :cond_7

    .line 26
    invoke-virtual {v2, v5}, Lorg/json/JSONArray;->get(I)Ljava/lang/Object;

    move-result-object p1

    invoke-virtual {v1, p1}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    add-int/lit8 v5, v5, 0x1

    goto :goto_5

    .line 27
    :cond_7
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {p1, v1}, Lcom/estrongs/android/ui/dialog/m0;->a(Lcom/estrongs/android/ui/dialog/m0;Lorg/json/JSONArray;)Lorg/json/JSONArray;

    .line 28
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/m0$b;->a:Lcom/estrongs/android/ui/dialog/m0;

    invoke-static {p1}, Lcom/estrongs/android/ui/dialog/m0;->g(Lcom/estrongs/android/ui/dialog/m0;)Landroid/os/Handler;

    move-result-object p1

    new-instance v0, Lcom/estrongs/android/ui/dialog/m0$b$a;

    invoke-direct {v0, p0}, Lcom/estrongs/android/ui/dialog/m0$b$a;-><init>(Lcom/estrongs/android/ui/dialog/m0$b;)V

    invoke-virtual {p1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_3
    .catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_3
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_3 .. :try_end_3} :catch_2
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_6

    :catchall_0
    move-exception p1

    goto :goto_7

    :catch_1
    move-exception p1

    .line 29
    :try_start_4
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_6

    :catch_2
    move-exception p1

    .line 30
    invoke-virtual {p1}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    goto :goto_6

    :catch_3
    move-exception p1

    .line 31
    invoke-virtual {p1}, Lorg/json/JSONException;->printStackTrace()V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    :goto_6
    return-void

    .line 32
    :goto_7
    goto :goto_9

    :goto_8
    throw p1

    :goto_9
    goto :goto_8
.end method
